package com.boot2.core;

import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangweilin
 * @description: 由于jpa默认的分页返回的是PageImpl,而此类没有无参构造，无法反序列化，也就无法走feign或缓存等，为了能被正常反序列化，需要包装PageImpl
 * @date 2019/1/4
 */
public class HlPageImpl<T> extends PageImpl<T> {

    public HlPageImpl() {
        super(new ArrayList<T>());
    }

    public HlPageImpl(HlPageImpl<T> hlPageImpl) {
        super(new ArrayList<T>());

    }

    public HlPageImpl(List<T> content, Pageable pageable, long total) {
        super(content, pageable, total);
    }

    public HlPageImpl(List<T> content) {
        super(content);
    }


}
